<html>
<head>
  <style>
    #box {
        position: absolute;
        left: 100px;
        top: 100px;
        height: 100px;
        width: 100px;
        background-color: green;
        animation: anim 1s linear infinite;
        border-image: url() 5 5 5 5 /20px stretch stretch;
        border-style: solid;
    }
    #boxShorthand {
        position: absolute;
        left: 100px;
        top: 250px;
        height: 100px;
        width: 100px;
        background-color: green;
        animation: animShorthand 1s linear infinite;
        border-style: solid;
    }
    #boxStatic {
        position: absolute;
        left: 100px;
        top: 400px;
        height: 100px;
        width: 100px;
        background-color: green;
        border-image: -webkit-cross-fade(url(resources/stripes-100.png), url(resources/green-100.png), 50%) 5 5 5 5 /20px stretch stretch;
        border-style: solid;
    }
    @keyframes anim {
        from { border-image-source: url(resources/stripes-100.png); }
        to   { border-image-source: url(resources/green-100.png); }
    }
    @keyframes animShorthand {
        from { border-image: url(resources/stripes-100.png) 5 5 5 5 /20px stretch stretch; }
        to   { border-image: url(resources/green-100.png) 5 5 5 5 /20px stretch stretch; }
    }
  </style>
  <script src="resources/animation-test-helpers.js" type="text/javascript" charset="utf-8"></script>
  <script type="text/javascript" charset="utf-8">
  // This test was flaky because it would start before the images were loaded.
  var imagesLoaded = 0;
  function imageLoaded() {
    ++imagesLoaded;
    if (imagesLoaded == 2) {
      const expectedValues = [
        // [time, element-id, property, expected-value, tolerance]
        // FIXME: We can't test reading the borderImage shorthand because of bug #13658.
        [2.5, ["box", "boxStatic"], "borderImageSource", 0.5, 0.05],
        [2.5, ["boxShorthand", "boxStatic"], "borderImageSource", 0.5, 0.05],
      ];

      var doPixelTest = true;
      var disablePauseAPI = false;
      var startTestImmediately = true;
      runAnimationTest(expectedValues, null, undefined, disablePauseAPI, undefined, startTestImmediately);
    }
  }
  </script>
</head>
<body>
<div id="box"></div>
<div id="boxShorthand"></div>
<div id="boxStatic"></div>
<div id="result"></div>
<img src="../animations/resources/stripes-100.png" onLoad="imageLoaded();"/>
<img src="../animations/resources/green-100.png" onLoad="imageLoaded();"/>
</body>
</html>
